﻿using System;
using System.Collections.Generic;
using System.Linq;
using System.Text;
using Nox.Amuse.Helpers;

namespace Nox.Amuse.ViewModel.Notification
{
    public class TaskBarButton
    {
        bool isFlashVisible;

        public TaskBarButton()
        {
            App.Messenger.Register(Messages.MainWindowActivated, () => { DismissNotification(); });
        }

        private void DismissNotification()
        {
            if (isFlashVisible)
            {
                System.Diagnostics.Debug.WriteLine("FlashOff");
                App.Current.MainWindow.StopTaskBarFlash();
                isFlashVisible = false;
            }
        }

        public void FlashNotify()
        {
            if (!App.Current.MainWindow.IsActive && !isFlashVisible)
            {
                System.Diagnostics.Debug.WriteLine("FlashOn");
                App.Current.MainWindow.StartTaskBarFlash();
                isFlashVisible = true;
            }
        }

    }
}
